package xin.common.web.view;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.sf.jasperreports.engine.data.JRMapCollectionDataSource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <pre>
 * TestPDFView
 * </pre>
 *
 * @author lixin_ma@outlook.com
 * @since 2018/11/28
 */
@Api(tags={"test"})
@Controller
@RequestMapping("pdf")
public class TestPDFView {
    @ApiOperation("test")
    @GetMapping
    public ModelAndView download() {
        Map<String, Object> map = new HashMap<>();
        map.put("name", "崔元辰");
        return new ModelAndView(new PdfView("templates/report/helloword.jasper", "helloword"),map);
    }
}
